/* 工作流主界面样式 */
.app-main-workflow {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  color: var(--text-color);
}

.workflow-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.workflow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--secondary-bg-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.workflow-header h2 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.workflow-actions {
  display: flex;
  gap: 10px;
}

.workflow-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.workflow-btn-primary {
  background: var(--primary-color);
  color: white;
}

.workflow-btn-primary:hover {
  background: var(--primary-hover-color);
}

.workflow-btn-secondary {
  background: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.workflow-btn-secondary:hover {
  background: var(--hover-color);
}

.workflow-btn-danger {
  background: #ff4757;
  color: white;
}

.workflow-btn-danger:hover {
  background: #ff3838;
}

.workflow-content {
  display: flex;
  flex: 1;
  height: calc(100% - 70px);
}

.workflow-sidebar {
  width: 250px;
  background: var(--secondary-bg-color);
  border-right: 1px solid var(--border-color);
  padding: 20px;
  overflow-y: auto;
}

.node-palette h3 {
  margin: 0 0 15px 0;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.node-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.node-type {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.node-type:hover {
  background: var(--hover-color);
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.node-type:active {
  cursor: grabbing;
  transform: translateY(0);
}

.node-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.node-type span {
  font-size: 14px;
  font-weight: 500;
}

.workflow-main {
  flex: 1;
  position: relative;
  background: var(--bg-color);
}

.workflow-canvas {
  width: 100%;
  height: 100%;
  position: relative;
}

.workflow-properties {
  width: 300px;
  background: var(--secondary-bg-color);
  border-left: 1px solid var(--border-color);
  padding: 20px;
  overflow-y: auto;
}

.properties-panel h3 {
  margin: 0 0 15px 0;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.node-properties {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.no-selection {
  color: var(--text-secondary-color);
  font-style: italic;
  text-align: center;
  margin: 20px 0;
}

.property-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.property-label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 14px;
}

.property-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
}

.property-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(69, 123, 255, 0.1);
}

.property-textarea {
  min-height: 80px;
  resize: vertical;
}

.property-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
}

/* React Flow 自定义样式 */
.react-flow__node {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.react-flow__node:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.react-flow__node.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(69, 123, 255, 0.3);
}

.react-flow__handle {
  background: var(--primary-color);
  border: 2px solid white;
  width: 8px;
  height: 8px;
}

.react-flow__edge {
  stroke: var(--border-color);
  stroke-width: 2;
}

.react-flow__edge.selected {
  stroke: var(--primary-color);
  stroke-width: 3;
}

.react-flow__edge-path {
  stroke: var(--border-color);
  stroke-width: 2;
}

.react-flow__edge.selected .react-flow__edge-path {
  stroke: var(--primary-color);
  stroke-width: 3;
}

.react-flow__controls {
  background: var(--secondary-bg-color);
  border: 1px solid var(--border-color);
}

.react-flow__controls button {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.react-flow__controls button:hover {
  background: var(--hover-color);
}

.react-flow__minimap {
  background: var(--secondary-bg-color);
  border: 1px solid var(--border-color);
}

.react-flow__background {
  background: var(--bg-color);
}

/* 自定义节点样式 */
.custom-node {
  padding: 12px 16px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.custom-node.input-node {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.custom-node.process-node {
  border-color: #2196F3;
  background: rgba(33, 150, 243, 0.1);
}

.custom-node.decision-node {
  border-color: #FF9800;
  background: rgba(255, 152, 0, 0.1);
}

.custom-node.output-node {
  border-color: #9C27B0;
  background: rgba(156, 39, 176, 0.1);
}

.custom-node.llm-node {
  border-color: #F44336;
  background: rgba(244, 67, 54, 0.1);
}

.custom-node.rag-node {
  border-color: #795548;
  background: rgba(121, 85, 72, 0.1);
}

.node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.node-content {
  font-size: 12px;
  color: var(--text-secondary-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .workflow-sidebar {
    width: 200px;
  }
  
  .workflow-properties {
    width: 250px;
  }
}

@media (max-width: 768px) {
  .workflow-content {
    flex-direction: column;
  }
  
  .workflow-sidebar,
  .workflow-properties {
    width: 100%;
    height: 200px;
  }
  
  .workflow-main {
    height: calc(100% - 400px);
  }
}
